<template>
  <PageableTable auto-height :data="commentList" header-bold hide-on-single-page :selection="false">
    <TableColumn label="办理人" prop="personalName" />
    <TableColumn label="办理环节" prop="activityName" />
    <TableColumn label="办理类型" prop="typeName" />
    <TableColumn label="办理意见" prop="message" />
  </PageableTable>
</template>

<script>
  import { getFlowLogs } from '@/api/admin/workitem'

  export default {
    name: 'ApprovalCommentRecord',
    props: {
      businessKey: String
    },
    data() {
      return {
        commentList: []
      }
    },
    watch: {
      businessKey: {
        immediate: true,
        handler: 'getCommentList'
      }
    },
    methods: {
      async getCommentList(businessKey) {
        const res = await getFlowLogs(businessKey)
        this.commentList = res.data.data
      }
    }
  }
</script>
